<%--
  Created by IntelliJ IDEA.
  User: caojian
  Date: 2017/3/10
  Time: 下午5:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div class="ui pagination menu">
    <c:choose>
        <c:when test="${!pagination.hasPreviousPage||pagination.pageNum==pagination.prePage}">
            <a class="icon item current">
                <i class="angle left icon"></i>
            </a>
        </c:when>
        <c:otherwise>
            <a class="icon item"
               href="${pageContext.request.contextPath}/${paginationAction}?pageNum=${pagination.prePage}">
                <i class="angle left icon"></i>
            </a>
        </c:otherwise>
    </c:choose>
    <c:forEach items="${pagination.navigatepageNums}" var="pageNum">
        <c:choose>
            <c:when test="${pagination.pageNum==pageNum}">
                <a class="item current">${pageNum}</a>
            </c:when>
            <c:otherwise>
                <a class="item"
                   href="${pageContext.request.contextPath}/${paginationAction}?pageNum=${pageNum}">${pageNum}
                </a>
            </c:otherwise>
        </c:choose>
    </c:forEach>
    <c:choose>
        <c:when test="${!pagination.hasNextPage||pagination.pageNum==pagination.nextPage}">
            <a class="icon item current">
                <i class="angle right icon"></i>
            </a>
        </c:when>
        <c:otherwise>
            <a class="icon item"
               href="${pageContext.request.contextPath}/${paginationAction}?pageNum=${pagination.nextPage}">
                <i class="angle right icon"></i>
            </a>
        </c:otherwise>
    </c:choose>
</div>

